package my.study.org.springframework.aop.examples.example1;

/**
 * 演奏家类 
 * @author fanhongjie
 *
 */
public class Instrumentalist1 implements Performer {
	
	private Instrument instrument;
	
	private Audience audience;
	
	private String song;
	
	public Instrumentalist1() {
		
	}
	public void perform() throws PerformanceException {
		audience.takeSeats();
		audience.turnOffCellPhones();
		System.out.println("Instrumentalist1.perform()");
		try {
			System.out.println("Playing " + song);
			instrument.play();
			audience.applaud();
			
		} catch (Exception e) {
			audience.demandRefund();
		}
		System.out.println("return Instrumentalist1.perform()");
	}

	public void setInstrument(Instrument instrument) {
		this.instrument = instrument;
	}

	public Instrument getInstrument() {
		return instrument;
	}
	public Audience getAudience() {
		return audience;
	}
	public void setAudience(Audience audience) {
		this.audience = audience;
	}
	public String getSong() {
		return song;
	}
	public void setSong(String song) {
		this.song = song;
	}
	
}
